package com.atpy.reggie.controller;


import com.atpy.reggie.common.R;
import com.atpy.reggie.entity.Employee;
import com.atpy.reggie.entity.StoreInformation;
import com.atpy.reggie.service.StoreInformationService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.val;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;

/**
 * (StoreInformation)表控制层
 *
 * @author makejava
 * @since 2023-04-17 19:25:02
 */
@RestController
@RequestMapping("storeInformation")
public class StoreInformationController extends ApiController {
    /**
     * 服务对象
     */
    @Resource
    private StoreInformationService storeInformationService;

    @GetMapping("/page")
    public R<List> page(){

        List<StoreInformation> list = storeInformationService.list();
        System.out.println(list);
        return R.success(list);
    }

    /**
     * 修改数据
     *
     * @param storeInformation 实体对象
     * @return 修改结果
     */
    @PostMapping("updata")
    public R<String> update(@RequestBody StoreInformation storeInformation) {

        boolean b = storeInformationService.updateById(storeInformation);
        if (b){
            return R.success("店铺修改成功");
        }
        return R.error("店铺修改失败");

    }

}

